<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        {{ name }} {{info}}
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <script>
       const app = new Vue({
            el: '#app',
            data() {
                return {
                    name: '林三心'
                }
            },
            computed: {
                info () {
                    return this.name
                }
            },
            watch: {
                name(newVal) {
                    console.log(newVal)
                }
            },
            methods:{
                init: function(){
                    this.name = '123'
                }
            },
            mounted(){
                console.log(this)
                this.init()
            }
        })
       app.mount()
    </script>
</body>
</html>